<?xml version="1.0" encoding="utf-8" ?>
<!-- 业务层的NHibernate定义 -->
<objects xmlns='http://www.springframework.net'>

  <!-- Assembly处理类的初始化 -->
  <object id="AssemblyTools" type="FastSpring.AssemblyTools,FastSpring.Net" factory-method="CreateAssemblyTools" singleton="true" />
  
  <!-- Spring.Net属性的Override -->
  <object id="appConfigPropertyOverride" type="Spring.Objects.Factory.Config.PropertyOverrideConfigurer, Spring.Core" singleton="true">
    <property name="configSections">
      <value>SpringOverrideProperty</value>
    </property>
  </object>
  
  <!-- 数据库参数配置 -->
  <!-- DB配置 -->
  <object id="DbProvider" type="FastSpring.Data.FastSpringDbProviderFactoryObject,FastSpring.Net" singleton="true">
    <property name="Provider" value="SqlServer-2.0"/>
    <property name="ConnectionString" value="Data Source=192.168.188.18;Database=FastSpringIssue;User ID=sa;Password=sa;Trusted_Connection=False"/>
  </object>

  <!-- NamingStrategy 表前缀的定义 -->
  <object id="NamingStrategy" type="FastSpring.NHibernateHelper.NamingStrategyCore,FastSpring.Net" singleton="true">
    <property name="TableHead" value="FS_"/>
  </object>

  <!-- NHibernate HBM配置 -->
  <object id="FastSpringMappingAssemblies" type="FastSpring.NHibernateHelper.FastSpringMappingAssemblies,FastSpring.Net" singleton="true">
    <property name="MappingAssemblies">
      <list>
        <value>FastSpring.Net.Core</value>
      </list>
    </property>
  </object>
  
  <!-- NHibernate SessionFactory的定义及初始化 -->
  <object id="SessionFactory" type="FastSpring.SpringHelper.DefaultSessionFactoryBean, FastSpring.Net">
    <constructor-arg name="NamingStrategy" ref="NamingStrategy"/>
    <property name="DbProvider" ref="DbProvider"/>
    <property name="FastSpringMappingAssemblies" ref="FastSpringMappingAssemblies" />
    <property name="HibernateProperties">
      <dictionary>
        <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
        <entry key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
        <entry key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
        <entry key="hibernate.connection.isolation" value="ReadCommitted" />
        <entry key="hibernate.show_sql" value="true"/>
      </dictionary>
    </property>
  </object>
  
  <!--添加存储过程的支持-->
  <object id="DBHelper" type="FastSpring.Base.Support.SQLHelper,FastSpring.Net">
    <property name="sessionFactory" ref="SessionFactory"/>
  </object>
  <!--添加存储过程的支持 END-->

  <!-- NHibernate的HibernateTransactionManager实例 -->
  <object id="HibernateTransactionManager" type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate12">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="sessionFactory" ref="SessionFactory"/>
  </object>
  <object id="TransactionInterceptor" type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
    <property name="TransactionManager" ref="HibernateTransactionManager"/>
    <property name="TransactionAttributeSource">
      <object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
    </property>
  </object>
  <object id="BaseTransactionManager"
          type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data" abstract="true">
    <property name="PlatformTransactionManager" ref="HibernateTransactionManager"/>
  </object>
  <!--<object id="ProjectManagerTrans" parent="BaseTransactionManager">
    <property name="Target" ref="ProjectManager"/>
    <property name="ProxyInterfaces" value="FastSpring.PMS.BLL.IProjectManager"/>
    <property name="TransactionAttributes">
      <name-values>
        <add key="TestTransaction*" value="PROPAGATION_REQUIRED,-BLLException"/>
      </name-values>
    </property>
  </object>-->
</objects>